aspose file tools*
The moose likes Web Services and the fly likes org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages" Watch "org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages" New topic
Author

org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages

Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
Hi,

We are migrating from Websphere 6.0 to JBoss 5.1 where we have one web service.

When I try to invoke the web service using my client code, I am getting the following exception:



Please help me if anybody have idea
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Check the WSDL to get the correct endpoint URL, perhaps the service URL for your webservice changed when you moved to a different app server. You can try out http://www.soapui.org/ to test your webservice.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I suggest using SOAPui or TCPMON to capture the complete SOAP request your client is generating. You may be surprised.

Bill
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
Hi,
Thanks for responses. I am using TCPIP Monitor to capture the request/response.

Please find the request/resposne I am getting through TCPIP monitor. I am getting two request and two responses as follows:

Request1
-------------


Response1
--------------


Request2
----------------


Response2
--------------


Do I need to change the WSDL? I am using the same client code with Axis which was generated using RAd for Websphere. do I need to re-generate the client using JBoss IDE for JBoss 5.1 however I have re-generated the server side code with JBossWS specification.

Please clarify me
1. whether I need to change the WSDL due to change of AppServer
2. Whether I need to re-generate the client code again due to change of AppServer and IDE

Please help me.
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

The server is returning HTML instead of a SOAP message. That's the problem. Check your endpoint in the request and what the service points are in the WSDL.
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
These are my WSDL contents. I am referring my localhost as endpoint URL.

WSDL Schema definition:
---------------------------

EndPoint URL
-------------------

Please let me know if there are mistakes.
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Use Soap UI as mentioned before, or use your web browser to see if you can access the WSDL directly from the web service, for instance: http://localhost:8080/vega/services/EpgFileTransferSOAP?wsdl
Change the URL, if needed, until the WSDL shows up in the browser, and not some HTML page. Also In your JBoss log file you should be able to find the service URLs somewhere (i.e. when the webservice app is deployed).
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
You are correct.

I am not able to get the WSDL when I try to access the Web service with the following URLs. I am getting always web page saying "Hello World"

1. http://localhost:8080/vega/services/EpgFileTransferSOAP?wsdl (JBoss Localhost Port)
2. http://localhost:18310/vega/services/EpgFileTransferSOAP?wsdl (TCPIP configured custom port)

I am able to see the following in my logs when server startup.



does it impactin anyway? How can I see the WSDL? How can I fix the issue?

Please.
Koen Aerts
Ranch Hand

Joined: Feb 07, 2012
Posts: 344

Try "tns:" instead of "service:" for the binding attribute in the wsdl:port element. Not sure if that is the problem though.
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
Still same error.



Any help please.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Have you captured the complete text of the SOAP request that causes this error response?

Both SOAPui and TCPMON allow you to save the captured request so you can examine and modify it. Look for <? ... ?> Processing instruction syntax.

Bill
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
Hi Willim,

I have pasted the request and response which tracked using TCPIP Monitor in this same thread above.

Please check and help me.

Thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
I guess the "processing instruction" error is spurious.

If you are still getting the two responses shown earlier:
1. a redirect HTTP/1.1 302 moved temporarily
and
2. a HTML Hello World page

then we must reluctantly conclude that your SOAP request never gets near a SOAP service and your client misinterprets the hello world page, throwing the error you see.

I should have picked up on this earlier as something similar happened to me - sorry.

Bill
Chandrasekhar Aadhanapattu
Greenhorn

Joined: Feb 29, 2012
Posts: 16
Any help, please.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Seems to me - if your SOAP request is not getting to a SOAP service you need to look at:

1. Are you using the right address?
2. Is the service really running?

Bill
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: org.xml.sax.SAXException: Processing instructions are not allowed within SOAP messages