Using namespaces in xpath when creating soap request

100 views
Skip to first unread message

mili...@wso2.com

unread,
Feb 22, 2015, 11:32:02 PM2/22/15
to soa-...@googlegroups.com
Hi,

I'm working on POC of using this library. And I have some questions which I was unable to find resources to refer.

Is it possible, and how to specify namespaces (using namespace prefix or any other method) in xpath when creating soap request as in the sample [1].

In the sample [1] we can provide soap element values by using hash map as follows. My problem is how we can specify namespaces of the xpath and if we can use namespace prefix, how we can define matching namespace.

    HashMap<String, String> formParams = new HashMap<String, String>();
    formParams.put("xpath:/create/article/name", "foo");
    formParams.put("xpath:/create/article/description", "bar");
        SOARequestCreator creator = new SOARequestCreator(wsdl, new RequestCreator(), new MarkupBuilder(writer));
    creator.setFormParams(formParams);

Does this support is provided by this library?


Highly appreciate if you can share information regarding this.

[1] http://www.membrane-soa.org/soa-model-doc/1.4/java-api/create-soap-request.htm

Thanks,
Milinda

Thomas Bayer

unread,
Feb 23, 2015, 3:36:57 AM2/23/15
to soa-...@googlegroups.com
Hi Milinda,

      Am 23.02.15 um 05:32 schrieb mili...@wso2.com:
Hi,

I'm working on POC of using this library. And I have some questions which I was unable to find resources to refer.

Is it possible, and how to specify namespaces (using namespace prefix or any other method) in xpath when creating soap request as in the sample [1].
No. It is not really XPath it is only a subset. It is used here to create a document and not to query one. Because you usually start at the root using / you can just address all the possible elements without namespaces. Of course the elements you create can be namespace prefixed. So it is only a restriction, when you are working with semi- or allmost unstructured SOAP messages. But SOAP is all about the contract and so it is not really a restriction.

Cheers,
Thomas




Reply all
Reply to author
Forward
0 new messages