Getting access to the soap:Envelope node in WebServices

Posted by bsgruenba on 18-Apr-2010 11:17

OpenEdge 10.2B

I am working on a WebServices client that needs to include additional xmlns: definitions on the soap:Envelope node in order to call a WebService.

I have tried using the SET-CALLBACK-PROCEDURE() on the port, but this only gets called after the XML is loaded into the DOM so it fails the well-formedness test.

I need the soap:Envelope node to look like the following, but I'm guessing that I am going to have to use sockets to do this. Correct?:

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
                xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"/>

All Replies

Posted by Admin on 18-Apr-2010 11:36

You're right Bruce. You can't do that with the direct Web Services

client in the ABL.

Posted by bsgruenba on 18-Apr-2010 12:14

Darn. That's a real pain. Sockets won't cut it for this situation. I'm going to end up having to write a Java service that can talk to both MS Exchange and OpenEdge to do this.

Posted by mresnick on 20-Apr-2010 09:16

Bruce,

Why must the namespace declarations be in the soap:Envelope element?

Thanks,

Michael

Posted by bsgruenba on 20-Apr-2010 09:58

mresnick wrote:

Bruce,

Why must the namespace declarations be in the soap:Envelope element?

Thanks,

Michael

Actually, Michael, that's a great question.

The API that I am dealing with is the Exchange Web Service API. I have been having a lot of trouble even getting to the point of being able to call it from inside OpenEdge, but that's more an SSL issue with NTLM authentication than anything else. My blog posting at http://www.thesoftwaregorilla.com/2010/04/exchange-web-services-starting-out/ describes what I have ended up with and how I got there.

The EWS api makes extensive use of the types that are defined in the types.xsd file and all messages are defined in messages.xsd. If you read the book I refer to in my blog post, even the guys at Microsoft on the Exchange team agree that this is a convoluted WSDL. The upshot is that the types and messages are needed in every node in the envelope.

After I posted this question, it occurred to me that I could actually set up the namespace declarations on the child nodes, but if I did that, each high-level node would need the declaration. This raises two questions for me that I still have to answer:

1) Am I going to cause some kind of namespace hiding as a result, and what is the impact of it? and

2) Would not the parser now have to load those .xsds for every node on which they are defined? If so, that means that the parser will be loading two files, one of which is over 4000 lines long and the other is around 1800, multiple times. That's a large number of XML nodes to be adding for something that could be done once.

[Bruce - edited] I just realized I am as dumb as a bag of rocks!!! This is a namespace, not an import. Question 2 is crap and not applicable anyway because even if it was an import, it's dealing with a non-existent URL on Microsoft's site - not the types.xsd file that I was thinking of... Sometimes I don't see the forest for the trees!!! [/Bruce - edited]

In at least some of the messages that will be sent, this could happen 3 or 4 times.

I am going to go back and play with this to figure out if I can work around the problem this way, but my priority was to prove that I could get it to work - which is where I am at. I would still like to be able to make the call directly from OpenEdge if possible.

Posted by bsgruenba on 20-Apr-2010 21:54

mresnick wrote:

Bruce,

Why must the namespace declarations be in the soap:Envelope element?

Thanks,

Michael

Following up, I have now changed the code to include the namespaces on the subordinate nodes, but I'm still fighting the certificate issues.

Thanks, Michael, for the advice.

This thread is closed