7 Replies Latest reply on Mar 6, 2007 9:29 AM by kukeltje

    Problem BPEL: SOAP Messages in a web service invocation

      Hello,
      I'm working with jBoss-4.0.5.GA, jbpm-bpel-1.1.Beta3 and jBossws.1.0.3.SP1.

      I have developed a simple bpel process with and invocation to a external web service. I deploy the process without problems but when I test it I have the following problem:
      The SOAP message to the web service is :

      <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
      <env:Header/>
      <env:Body>
      <defaultNS:CapitalCity xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:defaultNS='null'>ES</defaultNS:CapitalCity></env:Body></env:Envelope>
      

      And the external server answer me with this:
      <soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>
      <soap:Header/>
      <soap:Body>
      <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
       <faultcode>soap:Server</faultcode>
       <faultstring>Error processing request: Invalid namespace 'null' expected 'http://www.oorsprong.org/websamples.countryinfo'</faultstring>
       <detail/>
      </env:Fault></soap:Body></soap:Envelope>
      


      The problem is that the process set the property 'DefaultNS' to null, but I don't know how to change this.

      How can I set the DefaultNS different from null?
      Maybe in the bpel-application.xml file?
      Should I use the latest version of jbossWS?

      The web service what I want to invoke is this
      http://www.oorsprong.org/websamples.countryinfo/CountryInfoService.wso
      and the operation is CapitalCity.

      Any idea??
      Thank you in advance

      Agus

        • 1. Re: Problem BPEL: SOAP Messages in a web service invocation
          aguizar

          jBPM sends whatever content you put in the message parts. How does your BPEL process create the content of the "parameters" part? Please post the relevant portions of your process only.

          • 2. Re: Problem BPEL: SOAP Messages in a web service invocation

            I found the problem.
            The eclipse designer create the 'parameters' parts like this:

            <bpws:to part="parameters" variable="atlasRequest">
            <bpws:query queryLanguage="http://www.w3.org/TR/1999/REC-xpath-19991116"><![CDATA[/ns0:sCountryISOCode]]></bpws:query>
            </bpws:to>
            

            But the correct way is this:
            <bpws:to>$atlasRequest.parameters/ns0:sCountryISOCode</bpws:to>

            The problem is fixed if I change this part, but I don't know why the eclipse designer uses 'query languages'.
            I hope that this post can help someone whit the same problem.

            From Spain, thank you very much Alejandro.

            Agus

            • 3. Re: Problem BPEL: SOAP Messages in a web service invocation
              aguizar

              Agus,

              The to variant with variable, part and query items is correct as well. This form comes from the BPEL 1.1 days when the $ notation for accessing variables did not exist yet.

              The difference lies in the '/' preceding your query. When you write:

              <to variable="atlasRequest" part="parameters" />

              or
              <to>$atlasRequest.parameters</to>

              you access the part element; in this case, ns0:CapitalCity. In your second fragment:
              <bpws:to>$atlasRequest.parameters/ns0:sCountryISOCode</bpws:to>

              ns0:sCountryISOCode is relative to ns0:CapitalCity. However, in your first fragment:
              <bpws:to part="parameters" variable="atlasRequest">
              <bpws:query><![CDATA[/ns0:sCountryISOCode]]></bpws:query>
              </bpws:to>

              the leading slash makes the location path absolute. Instead of appending ns0:sCountryISOCode to the ns0:CapitalCity element, you are appending to the owner document of ns0:CapitalCity! Because the owner document already has ns0:CapitalCity as its root element, appending another element should result in a fault.

              The following code essentially performs the same operations that jBPM performs to evaluate a query on a part element.
              Element capitalCity = XmlUtil.createElement("capitalCity");
              
              Query query = new Query();
              query.setText("/countryIsoCode");
              
              query.getEvaluator().assign(capitalCity, "MX");
              
              assertEquals("capitalCity", capitalCity.getOwnerDocument().getDocumentElement().getLocalName());


              The code throws a BpelFaultException from the assign() call.

              Regarding the query language, the URI:
              http://www.w3.org/TR/1999/REC-xpath-19991116

              is the BPEL 1.1 reference for XPath 1.0. BPEL 2 replaced it with:
              urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0

              The Eclipse designer should be using the latter reference.

              Since XPath 1.0 is the default language, you are better off removing the queryLanguage attribute.

              • 4. Re: Problem BPEL: SOAP Messages in a web service invocation
                aguizar

                PS. Saludos hasta España, tierra de Cides y Quijotes :-)

                • 5. Re: Problem BPEL: SOAP Messages in a web service invocation
                  kukeltje

                  ok, now I'm officially curious... Quijotes I can find on the internet.. but cides is impossible to find... HEEEELLLLPPPP :-)

                  • 6. Re: Problem BPEL: SOAP Messages in a web service invocation
                    aguizar

                    http://en.wikipedia.org/wiki/El_Cid

                    Anything goes in this forum, from sarcastic jokes to cultural references :-)

                    • 7. Re: Problem BPEL: SOAP Messages in a web service invocation
                      kukeltje

                      Ah, ok 'lords' and toads (i.e. someone with high pretences)

                      Now I can rest in peace (the coming night that is)