aspose file tools*
The moose likes XML and Related Technologies and the fly likes how to send a soap message  by argument to the server usingservice without call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "how to send a soap message  by argument to the server usingservice without call" Watch "how to send a soap message  by argument to the server usingservice without call" New topic
Author

how to send a soap message by argument to the server usingservice without call

sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
Dear seniors
i m creating one web service . My aim is to create the web service for a given xml file.That is the input is one xml file for my java class i want to create the soap message for the given xml input and pass it to server the server has one implementation class and one interface class using one build xml i m creating the war file for server.

""Now i want to send the SOAPMESSAGE argument to the server.Using SERVICE how to send the argument to the server.""

ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service helloService = serviceFactory.createService(helloWsdlUrl,new QName(nameSpaceUri,serviceName));
JAXMClient.JAXMServiceIF objSoap=(JAXMClient.JAXMServiceIF)
helloService.getPort(new QName(nameSpaceUri,portName),JAXMClient.JAXMServiceIF.class);
SOAPMessage soapResult=objSoap.onMessage(message);

JAXMServiceIF is my server side interface.

i got the error in this place.

how can i send the soap message by argumnt to server



thanks


Sakthi.C
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
i got the error in this place.

How do you expect to get any advice if you don't give the details of the error? Java error/exception messages can be very informative - you need to learn how to read them.
Bill
sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
sorry sir,i attached my error message with this mail below see that and give me the solution
thank you very much for considering my request

regards
This is my error message

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Compiling the client source code....
Compiling 1 source file to D:\Sample\service\eighthillclient\build
D:\Sample\service\eighthillclient\src\JAXMClient.java:72: cannot resolve

symbol : class JAXMServiceIF
location: class JAXMClient.JAXMClient
JAXMClient.JAXMServiceIF objSoap=(JAXMClient.JAXMServiceIF)
^
D:\Sample\service\eighthillclient\src\JAXMClient.java:72: cannot resolve

symbol : class JAXMServiceIF
location: class JAXMClient.JAXMClient
JAXMClient.JAXMServiceIF objSoap=(JAXMClient.JAXMServiceIF)
^
D:\Sample\service\eighthillclient\src\JAXMClient.java:73: cannot resolve

symbol : class JAXMServiceIF
location: class JAXMClient.JAXMClient
helloService.getPort(new QName(nameSpaceUri,portName),JAXMClie
iceIF.class);
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5

That is a typical compiler error due to the compiler not being able to find that class.
Either the class is not on the classpath the compiler is using, the class is not imported properly to your source code, -OR- you have made an error in the spelling of the class or package.
Bill
sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
i got solve that errors the error was occuared because of the naming collision i chenge the class name and package name that gave me the splution for that error.Now i got one new error the error is
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
[javac] D:\Sample\service\eighthillclient\src\jAXMClient.java:71: onMessage(
JAXMClient.SOAPMessage) in JAXMClient.JAXMServiceIF cannot be applied to (javax.
xml.soap.SOAPMessage)
[javac] SOAPMessage soapResult=objSoap.onMessage(msg);
[javac] ^
[javac] 1 error

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
how can i rectify this error
i use this method to invoke the the server interface and pass the SOAPMessage argument to this server
"""""""""""""""""""""""""""""""""""""""""
SOAPMessage soapResult=objSoap.onMessage(message);

"""""""""""""""""""""""""""""
i gave the full interface invokation in my first querry


please give me the solution
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5

This error message is saying that the signature of the onMessage method does not match the class of the object you are trying to pass. In other words, a JAXMClient.SOAPMessage can not be cast to a xml.soap.SOAPMessage reference.
sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
thanks for considering my request

another query also i have how to pass the soap message as argument to the server interface class.The connection.call method doesnt use for our requirement so please give me the solution

thanks
sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
please anybody know the solution give me the solution
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
William quite clearly explained that your compilation error is because you're trying to invoke a method which expects to get an instance of "foo.Bar" while you're giving it an instance of "abc.def.Bar".


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
sakthi vadivelan
Greenhorn

Joined: Nov 15, 2004
Posts: 14
now that error cleared but it gave me a new error i cant send the soap message from client to the server so how to send the soap message without using connection.call(); method

thanks for considering my request
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to send a soap message by argument to the server usingservice without call