permaculture playing cards
The moose likes Web Services and the fly likes no protocol: <soap:Envelope ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark " no protocol: <soap:Envelope ?" Watch " no protocol: <soap:Envelope ?" New topic
Author no protocol: <soap:Envelope ?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Hi All-

I'm running into an xml validation issue on the return from a ws call.

I am calling the web service using HttpURLConnection in a servlet.

I get a good response, with a soap envelope, and I want to parse the xml.

The problem is that I get the above error,probably due to missing schemas.

my code:

String getSubscriptionIdFromResponse(String response) {
InputSource is = new InputSource(response);
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
SaxHandler handler = new SaxHandler();
parser.parse(is, handler);
return handler.subscriptionId;
} catch (Exception e) {
return "error occurred";


the response string:
<soap:Envelope xmlns:soap="" xmlns:xsd="" xmlns:xsi=""><soap:Body xmlns:ns1=""><SubscribeResponse xmlns=""><SubscriptionReference xmlns=""><Address xmlns="">https://w02777/orion/soap?ServiceName=NotificationProducer</Address><ReferenceParameters xsi:type="ns:FooReferenceParametersType" xmlns:ns="" xmlns=""><SubscriptionId xmlns="">TCSN_foo_Subscriber_331DAA98-4DC7-11DF-836B-AE4F0AC5625E</SubscriptionId></ReferenceParameters></SubscriptionReference></SubscribeResponse></soap:Body></soap:Envelope>

I've tried setting systemId but I suspect the problem is that I don't have a valid DTD.

All I want to do is parse one field.

any ideas?
Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
This turned out to be due to my setting the input source from a string of xml I had built from reading the input stream.
Once I set the source directly from the input stream directly - which included the protocol, it worked.
Consider Paul's rocket mass heater.
subject: no protocol: <soap:Envelope ?
It's not a secret anymore!