Hi Ben,

correct, the load of the WSDL is made into the validate() method. It's here that the component get the target WSDL, parse it and load.

On my side, I have requested the target WSDL and the deployment debug log, to try to load it (in a debugged unit test) and see why we have an error in the javax.xml loader.

Could you provide both please ?

Regards
JB

Brown, Ben wrote:
Thanks for the quick answers JB, Vivian

I have been exploring a little further and digging into the code.  It appears 
that the issue occurs during the validate method on CxfBcProvider, specifically 
on:

description = WSDLFactory.newInstance().newWSDLWriter()
                        .getDocument(swBuilder.build());

It actually appears that during the build() method the Definition that is 
returned, the map of namespaces inside contains a namespace named ns1 but does 
not have a URI to go with that namespace.  This seems to be where the ns1 is 
coming from, and the reason it is blowing up.

Looking at the WSDL (attached and company name removed), and then checking the 
namespaces with those in the map during debugging, it appears to be the 
http://schemas.microsoft.com/2003/10/Serialization/ namespace that is causing 
the issues.  My thoughts on why this might be the case are firstly that the xs 
namespace is only declared on the first xs element and NOT on the 
wsdl:definitions element and that possibly this is therefore not picked up by 
the code.

Both of you asked about the actual messages sent, however this error is 
occurring during deployment of the component, and so I'm not actually sending a 
Soap message as yet, because the component won't deploy - so I'm doubting that 
it has anything to do with this.

Please shout if you need any more information.

Thanks

Ben Brown



-----Original Message-----
From: Jean-Baptiste Onofré [mailto:[email protected]] Sent: 31 July 2009 13:33
To: [email protected]
Subject: Re: Error Parsing WSDL with CXF-BC

Agreed Vivian,

My comment was more concerning the ns1 namespace. It's not because the provided WSDL doesn't contain the namespace that it can't be present in the exposed one.

The HTTP component especially can:
- generate a WSDL using an abstract one (for example provided by the target endpoint). The abstract WSDL contains only type, message and port type. It doesn't contain binding. In this case, the component import the abstract WSDL (using <wsdl:import/>) and add SOAP binding. It's the case in the soap-consumer endpoint when the target one define an abstract WSDL (as it's the case for the exec component). I began a work to add abstract WSDL support in most of components. - take a WSDL and make cleanup on it. By cleanup, I mean that the HTTP component get the port type (the first one or the one corresponding to the service definition), delete all other port types, services, bindings and make a port type decoration. By port type decoration, I mean that it takes the original port type, the service name and construct the corresponding binding (it's done by PortTypeDecorator.decorate() method).

I hope that I was clear :)

Regards
JB

Madesclair Vivian wrote:
Well my understanding is still limited, but the CXF component only add the SOAP 
wrapper right? So if the message, witch contains the tag of the method to call 
use an invalid namespace, it might go wrong. I didn't mean to say that the CXF 
sends a bad message, but the incoming message in CXF (and therefore the output) 
might be wrong.

Or maybe I am. And btw what is port decoration?

Regards,
Vivian


-----Message d'origine-----
De : Jean-Baptiste Onofré [mailto:[email protected]] Envoyé : vendredi 31 juillet 2009 14:09
À : [email protected]
Objet : Re: Error Parsing WSDL with CXF-BC

No Vivian,

HTTP and CXF-BC can use port decoration and so can add new binding and 
namespace.

Ben, could you provide the target WSDL (the one used by the provider) and the 
SMX debug log file ? (I will check in the component).

Regards
JB

Madesclair Vivian wrote:
Hi Ben

If you wsdl doesnt contain a ns1 namespace, I guess the error comes from the SOAP message that your CXF component is sending to your external service. Do you know the content of this message? (You can activate debug mode of log4j if needed)

If you still can't solve your problem, can you provide us with the content of the message and the wsdl? (you can attach the file)

Regards
Vivian

-----Message d'origine-----
De : Brown, Ben [mailto:[email protected]]
Envoyé : vendredi 31 juillet 2009 12:01 À : [email protected] Objet : Error Parsing WSDL with CXF-BC

Hi All

I am attempting to connect to an external web service using a CXF-BC provider.  
On deployment of my service unit I am getting the following exception thrown:

<loc-message>javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute 
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.</loc-message>

<stack-trace><![CDATA[javax.jbi.management.DeploymentException:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.: 
org.xml.sax.SAXParseException: The value of the attribute 
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid. Prefixed 
namespace bindings may not be empty.

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
50
4)

        at
org.apache.servicemix.common.AbstractDeployer.validate(AbstractDeployer.
java:58)

        at
org.apache.servicemix.common.xbean.BaseXBeanDeployer.validate(BaseXBea
nD
eployer.java:55)

        at
org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(Abstra
ct
XBeanDeployer.java:97)

        at
org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServi
ce
UnitManager.java:88)

        at
org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseService
Un
itManager.java:69)

        at
org.apache.servicemix.jbi.framework.DeploymentService.deployServiceAss
em
bly(DeploymentService.java:520)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateServic
eA
ssembly(AutoDeploymentService.java:349)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.updateArchiv
e(
AutoDeploymentService.java:255)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.monitorDirec
to
ry(AutoDeploymentService.java:658)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService.access$800(A
ut
oDeploymentService.java:63)

        at
org.apache.servicemix.jbi.framework.AutoDeploymentService$1.run(AutoDe
pl
oymentService.java:622)

        at java.util.TimerThread.mainLoop(Timer.java:512)

        at java.util.TimerThread.run(Timer.java:462)

Caused by: javax.wsdl.WSDLException: WSDLException:
faultCode=PARSER_ERROR: Problem parsing '- WSDL Document -'.:
org.xml.sax.SAXParseException: The value of the attribute 
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed name

space bindings may not be empty.

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at com.ibm.wsdl.xml.WSDLWriterImpl.getDocument(Unknown Source)

        at
org.apache.servicemix.cxfbc.CxfBcProvider.validate(CxfBcProvider.java:
47
4)

        ... 13 more

Caused by: org.xml.sax.SAXParseException: The value of the attribute 
"prefix="xmlns",localpart="ns1",rawname="xmlns:ns1"" is invalid.
Prefixed namespace bindings may not be empty.

        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)

        ... 16 more

]]></stack-trace>

I have found a few messages on the mailing list that have similar errors, 
however none seem to have any solutions - apologies if this is not the case I 
have tried to search for an answer.

The WSDL that I am reading does not contain a namespace called ns1, so first 
question - is this an exception to do with parsing the external WSDL or 
something to do with an internally generated WSDL?

In either case, does anyone have any clue as to how this can be solve, or the 
'usual' causes for something like this.  I will probably be unable to post a 
link to the WSDL easily, however I can try to obfuscate out all identifying 
information if this would be useful to people.

Incidentally, originally the WSDL contained a target namespace of http://tempuri.org 
<http://tempuri.org/>  - but I had this changed as this appeared to cause 
errors where the target namespace did not match the actual namespace for the service. 
 At this stage the SA would deploy correctly with an error message, but no messages 
could be delivered as it had obviously not parsed the WSDL correctly.

Thanks in advance.

Ben Brown

This email and any files or information it contains are confidential and may be privileged. It is for the intended addressee(s) only. The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email. Please notify the sender immediately and delete this message from your system.
Please note that any opinions presented in this email are solely those of the 
author (or those of a third party whose statement is forwarded) and do not 
necessarily represent those of any company within the Bluefin Group Limited 
group of companies.

Email transmission cannot be guaranteed to be secure or error free as 
information could be intercepted, corrupted, lost, destroyed, late in arriving 
or incomplete as a result of the transmission process.  The sender therefore 
does not accept liability for any errors or omissions in the contents of this 
message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should 
check this email and any attachments for the presence of viruses.  The Bluefin 
Group Limited group of companies accepts no liability for any damage caused by 
any virus transmitted by this email.

--------------------------------------------------------------
Protection | Management | Compliance - scanned for viruses and unwanted content 
by emailsystems

Why use a managed email service? Click here to find out
This email and any files or information it contains are confidential and may be privileged. It is for the intended addressee(s) only. The unauthorised use, disclosure or copying of this email or any information it contains, is prohibited and could, in certain circumstances be a criminal offence. If you are not the intended recipient you should not disseminate or copy this email. Please notify the sender immediately and delete this message from your system.
Please note that any opinions presented in this email are solely those of the 
author (or those of a third party whose statement is forwarded) and do not 
necessarily represent those of any company within the Bluefin Group Limited 
group of companies.

Email transmission cannot be guaranteed to be secure or error free as 
information could be intercepted, corrupted, lost, destroyed, late in arriving 
or incomplete as a result of the transmission process.  The sender therefore 
does not accept liability for any errors or omissions in the contents of this 
message which arise as a result of email transmission.

WARNING: Computer viruses can be transmitted by email. The recipient should 
check this email and any attachments for the presence of viruses.  The Bluefin 
Group Limited group of companies accepts no liability for any damage caused by 
any virus transmitted by this email.

Reply via email to