*
The moose likes Web Services and the fly likes Soap response contains wsdl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Soap response contains wsdl" Watch "Soap response contains wsdl" New topic
Author

Soap response contains wsdl

Shasi Sekar
Greenhorn

Joined: Aug 22, 2008
Posts: 23
Hi All,

I created a SOAP request in java and sent to the webservice, it response contains the wsdl and not the response expected.

The same request sent through SOAPUI responds properly as expected.

I am bit confused can any body help me.

Earlier when i created a sample service and sent a request to the sample. the response for that request was as expected.

I followed the same steps here,but the response is a wsdl .


Regards,
Shasi Sekar
Naren Mane
Greenhorn

Joined: Mar 02, 2011
Posts: 16

Hi,

Can you share some more info like piece of code you are using or web service URL you are hitting so that I can check what is going wrong.

Thanks.
Shasi Sekar
Greenhorn

Joined: Aug 22, 2008
Posts: 23
Code for creating the soap message and invoking the service


response.writeTo(System.out) ==> returns the wsdl and not the exact response

But when generated soapMessage is used in soapUI it gives the exact response
Naren Mane
Greenhorn

Joined: Mar 02, 2011
Posts: 16

Hi,

1) As I can see that you have WSDL url with you then why are you digging with SAAJ api? If you are aware of AXIS2 , you can directly generate java stub from your wsdl and then just fire method you want to and obtain response. SAAJ apis are not that reliable.

2) Did you try mentioning endpoint url without "?wsdl" ?
Did you verify that your SOAP request is getting constructed as expected and accurately?
Also you can send your soap message directly through a URLConnection.

Provide SOAP request you are sending (One from SOAPUI and one constructed in your code).



Thanks.
Shasi Sekar
Greenhorn

Joined: Aug 22, 2008
Posts: 23
Thanks a lot naren mane,

It worked well when i removed "?wsdl".

But i am still confused.Can you explain me how it works without adding "?wsdl".
Because when i created a sample web service,I connected it with "?wsdl" and the response was as expected.


MAY BE I AM MISSING SOMETHING.


Thanks in advance
Shasi
Naren Mane
Greenhorn

Joined: Mar 02, 2011
Posts: 16

Hi,

You are welcome Shasi.

1) When you add "?wsdl" to webservice URL and hit it in a browser what you see is a service contract which is also called as WSDL file. It is just a view file mentioning all the bindings, data, apis etc etc.

2) And a webservice url without a "?wsdl" is a service with which data is sent in actual.That is the endpoint URL to which request/data is posted and user receives response accordingly.

Thus if you hit a ws url with "?wsdl", will return you contract and is not a valid service url.It is document URL.


Thanks.
 
Consider Paul's rocket mass heater.
 
subject: Soap response contains wsdl
 
Similar Threads
Problem with the missing namespace
How to call web service
Help Neeed to write a Client Application from WSDL
How to order the elements in soap message?
WebServices - How it is working