Wednesday, January 21, 2009

hostname with and without domain name issue

Why I write this?

The reason why I write this is as I faced this.
Some kind of a behaviour that I have never seen to known, but yes I did find this.

What did I see?

I was happy developing my BPEL process. everything looks cool and alright.
Now I had BPEL process A and B.

A was calling process B
B was developed happily and deployed

Started developing A, this is when I see this strange error
When I tried to create a partner link for B from the service explorer in partner link wizard
"The WSDL could not be located" error was displayed in the wizard

How can that be?

Yes how can this be, I was actually using the service explorer and making my way to B and selecting it and still WSDL not discoverable
What stupidity, how can this be?

What does the partner link actually not like?

Well, what I found is this. The URL for webservice was causing the issue. The wonderful hostname.

The URL from service explorer did not have the domain name in the hostname.
When I added the domain name there in the WSDL location, the WSDL was working alright.

Strage aint it.

What was the other issue?

The WSDL was alright, but there was some thing else that broke.
When I tried to deploy A it came back with the following error.

Error:
[Error ORABPEL-10902]: compilation failed
[Description]: in "bpel.xml", XML parsing failed because "undefined part element.
In WSDL at "http://hostname.domainname:portnumber/orabpel/domain/B/B?wsdl", message part element "{http://schemas.xmlsoap.org/ws/2003/03/addressing}MessageID" is not defined in any of the schemas.
Please make sure the spelling of the element QName is correct and the WSDL import is complete.
".
[Potential fix]: n/a.


What does the error mean?

When I opened up the WSDL from BPEL console I saw this.
The WSDL from BPEL console was looking like this http://hostname:portnumber/orabpel/domain/B/B?wsdl
With out the domain name.

Also when I opened the WSDL, the ws-addrressing was like this
<schema>
<import namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" schemaLocation="http://domainname:portnumber/orabpel/xmllib/ws-addressing.xsd"/>
</schema>


The domain name was missing from the import.

What does this mean?

As the domain was missing the server could not locate the import from ws-addressing.
And the namespace that was present right at the taop was
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
wsa was refering to wsa:RelatesTo, wsa:MessageID and wsa:ReplyTo
All these should be failing one by one in trial to deploy to the server the BPEL process that tries to partnerlink B.

How to fix this?

The fix is as simple as changing the WSDL to have the complete domain name in hostname.

But how to do that?

The change is as simple as this.
Open up the file ${OracleAS_Home}\bpel\system\config\collaxa-config.xml

Change the following
Property name soapServerUrl

<property id="soapServerUrl">
<name>BPEL soap server URL</name>
<value>http://hostname:portnumber</value>
<comment>
<![CDATA[This URL is published as part of the SOAP address of a process in the WSDL file.<p/> The hostname and port for this URL should be customized to match the hostname of your system and the port of your HTTP gateway.]]>
</comment>
</property>

To
<property id="soapServerUrl">
<name>BPEL soap server URL</name>
<value>http://hostname.domain:portnumber</value>
<comment>
<![CDATA[This URL is published as part of the SOAP address of a process in the WSDL file.<p/> The hostname and port for this URL should be customized to match the hostname of your system and the port of your HTTP gateway.]]>
</comment>
</property>

Also change similarly in the next property
soapCallbackUrl

What caused the problem?

During install the hostname file had the server host name before the hostname with domain name causing all this error.
So be sure to install with care and check the host file before install. Even if you break it, you are sure now how to fix this, aint you!!

1 comment:

Unknown said...

sweet, had a similar problem that's now fixed. Thanks!