You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by MRneedHelp <ma...@freenet.de> on 2016/09/15 09:15:20 UTC

SAP Webservice: None of the policy alternatives can be satisfied

Hi,

i´m new to CXF and trying to connect to a SAP Webservice. I use the newest
cxf version 3.1.7.
I have the WSDL from the webservice and generated code with wsdl2java.

I should update a program from Axis2 to CXF. But when i start the standard
client (genarted with wsdl2java) i get a "SOAPFaultException: None of the
policy alternatives can be satisfied."

Now i searched for 3 days on the internet and i know that the error occurs,
because some SAP policies are not supported by cxf. I know several solutions
for this problem, but none of them is working...

I tried it with the JaxWSFactoryBean: 
http://stackoverflow.com/questions/12072500/apache-cxf-none-of-the-policy-alternatives-can-be-satisfied
<http://stackoverflow.com/questions/12072500/apache-cxf-none-of-the-policy-alternatives-can-be-satisfied>  
But when i use the code, i get a "ServiceConstructionException: Could not
find definition for service" in the "factory.create()" line. I searched for
the exception and think, it is because of differences in "namespaces". But i
could not find any difference in the code to the wsdl.

Well so, back to the basic code from wsdl2java.
I read many posts, that say to use Interceptors and AssertionBuilders, but I
could not get it, how to imlement them or use them. 
I also dont know, if i really need them. I just want to connect with the SAP
Webservice. I can just ignore all policies in the wsdl, but i cant remove
them from the wsdl. In the Axis2 code the policies were overwritten with a
default policy, which was accepted.
I´ve tryed the IgnorablePolicyInterceptorProvider, self implemented in java
or with a bean in the cxf.xml file, but nothing worked. Im not sure, if i
did it right.

So my question is: IS there a simple way to just ignore all policies and get
access to the SAP webservice? (With soap UI it works perfectly).

Thank you in advance. 

Matthew



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAP Webservice: None of the policy alternatives can be satisfied

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

In case if SAP web service doesn't force special headers / security, you can just use generated service interface and set address in the factory explicitly, without using WSDL:

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

factory.setAddress("https://mydomain.com/myservice"); 
HelloWorld client = factory.create(HelloWorld.class);
System.out.println(client.sayHi("World"));

Regards,
Andrei.

> -----Original Message-----
> From: MRneedHelp [mailto:matthias.rudingsdorfer@freenet.de]
> Sent: Donnerstag, 15. September 2016 11:15
> To: users@cxf.apache.org
> Subject: SAP Webservice: None of the policy alternatives can be satisfied
> 
> Hi,
> 
> i´m new to CXF and trying to connect to a SAP Webservice. I use the newest cxf
> version 3.1.7.
> I have the WSDL from the webservice and generated code with wsdl2java.
> 
> I should update a program from Axis2 to CXF. But when i start the standard
> client (genarted with wsdl2java) i get a "SOAPFaultException: None of the
> policy alternatives can be satisfied."
> 
> Now i searched for 3 days on the internet and i know that the error occurs,
> because some SAP policies are not supported by cxf. I know several solutions
> for this problem, but none of them is working...
> 
> I tried it with the JaxWSFactoryBean:
> http://stackoverflow.com/questions/12072500/apache-cxf-none-of-the-policy-
> alternatives-can-be-satisfied
> <http://stackoverflow.com/questions/12072500/apache-cxf-none-of-the-policy-
> alternatives-can-be-satisfied>
> But when i use the code, i get a "ServiceConstructionException: Could not find
> definition for service" in the "factory.create()" line. I searched for the exception
> and think, it is because of differences in "namespaces". But i could not find any
> difference in the code to the wsdl.
> 
> Well so, back to the basic code from wsdl2java.
> I read many posts, that say to use Interceptors and AssertionBuilders, but I
> could not get it, how to imlement them or use them.
> I also dont know, if i really need them. I just want to connect with the SAP
> Webservice. I can just ignore all policies in the wsdl, but i cant remove them
> from the wsdl. In the Axis2 code the policies were overwritten with a default
> policy, which was accepted.
> I´ve tryed the IgnorablePolicyInterceptorProvider, self implemented in java or
> with a bean in the cxf.xml file, but nothing worked. Im not sure, if i did it right.
> 
> So my question is: IS there a simple way to just ignore all policies and get
> access to the SAP webservice? (With soap UI it works perfectly).
> 
> Thank you in advance.
> 
> Matthew
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAP-
> Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by kupkaj <ju...@gmail.com>.
I'm afraid it doesn't, since we don't see the problematic part - what is
flowing through the java client.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772928.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
Maybe this helps to solve the problem.

A xml request from SOAP UI:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
<soapenv:Header/>
   <soapenv:Body>
      <urn:GetPersonalinfo>
         <EtData>
         </EtData>
      </urn:GetPersonalinfo>
   </soapenv:Body>
</soapenv:Envelope>

and an example response:

<soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
   <soap-env:Header/>
   <soap-env:Body>
      <n0:ZHrBfftGetPersonalinfoResponse
xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
         <EtData>
            <item>
                    ......
            </item>
         </EtData>
      </n0:ZHrBfftGetPersonalinfoResponse>
   </soap-env:Body>
</soap-env:Envelope>



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772927.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by kupkaj <ju...@gmail.com>.
Hi,

in the line
factory.setAddress(wsdlAddress); 
wsdl from soapui is correct one (since you've confirmed it's working).


Different results mean differences in requests, so what you could do next is
to configure logging on client side and compare messages you are sending
from soapUI and your java client.

For setting up logging, try following code:
//optional - if you are using log4j
System.setProperty("org.apache.cxf.Logger",
"org.apache.cxf.common.logging.Log4jLogger");

factory.getFeatures().add(new org.apache.cxf.feature.LoggingFeature());
call it before GETPERSONALINFO client =
factory.create(GETPERSONALINFO.class); 




--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772926.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
Hi,

still trying to get cxf working. That can´t be an unsolvable problem...

So there are a few things, that i noticed. The URL in SOAP UI differs from
the URL of the wsdl in my Webbrowser. So which URL should I use?

So, from the beginning:
I generated the java code with wsdl2java again (command: wsdl2java -client
get_personalinfo.xml).
So I got 10 classes: 
<http://cxf.547215.n5.nabble.com/file/n5772921/classes.png>  

That´s , how my standard client(GETPERSONALINFO_GETPERSONALINFO_Client.java)
looks like:

GETPERSONALINFO_Service ss = new GETPERSONALINFO_Service(wsdlURL,
SERVICE_NAME);
GETPERSONALINFO port = ss.getGETPERSONALINFO();  

{
	System.out.println("Invoking GetPersonalinfo...");
	TableOfPersonalinfo etDataVal = null;
	javax.xml.ws.Holder<TableOfPersonalinfo> etData = new
javax.xml.ws.Holder<TableOfPersonalinfo>(etDataVal);
	port.GetPersonalinfo(etData);
	System.out.println("etData=" + etData.value);
}

I replaced the 
GETPERSONALINFO_Service ss = new GETPERSONALINFO_Service(wsdlURL,
SERVICE_NAME);
GETPERSONALINFO port = ss.getGETPERSONALINFO();  

with

JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
//factory.setServiceClass(GETPERSONALINFO.class);
factory.setAddress(wsdlAddress); 
GETPERSONALINFO client = factory.create(GETPERSONALINFO.class);

I hope, that was what you meant?
I dont know if I need the factory.setServiceClass(...), i dont notice any
differences, when using the line.

Depending on the wsdl URL i use, i get different exceptions:

URL from SOAP UI:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Fehler bei
der Web-Service-Verarbeitung; Weitere Details im Web-Service-Fehlerprotokoll
auf Provider-Seite 
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
	at com.sun.proxy.$Proxy44.GetPersonalinfo(Unknown Source)
	at Test.main(Test.java:33)
Caused by: org.apache.cxf.binding.soap.SoapFault: Fehler bei der
Web-Service-Verarbeitung; Weitere Details im Web-Service-Fehlerprotokoll auf
Provider-Seite 
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:86)
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:52)
	at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:41)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112)
	at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
	at
org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
	... 2 more


With the wsdl URL from my Webbrowser I get this exception:

Sep 21, 2016 11:21:09 AM org.apache.cxf.phase.PhaseInterceptorChain
doDefaultLogging
WARNUNG: Interceptor for
{urn:sap-com:document:sap:soap:functions:mc-style}GETPERSONALINFOService#{urn:sap-com:document:sap:soap:functions:mc-style}GetPersonalinfo
has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: "http://schemas.xmlsoap.org/wsdl/",
the namespace on the "definitions" element, is not a valid SOAP version.
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:130)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:174)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:69)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
	at com.sun.proxy.$Proxy44.GetPersonalinfo(Unknown Source)
	at Test.main(Test.java:33)

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
"http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions"
element, is not a valid SOAP version.
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:161)
	at com.sun.proxy.$Proxy44.GetPersonalinfo(Unknown Source)
	at Test.main(Test.java:33)
Caused by: org.apache.cxf.binding.soap.SoapFault:
"http://schemas.xmlsoap.org/wsdl/", the namespace on the "definitions"
element, is not a valid SOAP version.
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:130)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:174)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:69)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1670)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1551)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1348)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:651)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:324)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:277)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139)
	... 2 more


Sorry for the german language in the exception text, I didnt find the
exception in english language. I googled the exception and think it is a SAP
specific exception? Does that mean, that I cant ignore the policies?
I cant understand, why it works in in SOAP UI without any workaround and in
cxf not...
Didnt show this, that the policies are ignorable?
As i said, it works in my solution with sending and getting a xml over a
HttpURLConnection.

I hope, that this helps anything...

Thank you in advance. 

Matthew



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772921.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
WOW, you are right....

Thats, the code I used...
GETPERSONALINFO port = (GETPERSONALINFO)
factory.create(GETPERSONALINFO.class);
System.out.println("Invoking GetPersonalinfo...");
TableOfPersonalinfo etDataVal = null;
javax.xml.ws.Holder<TableOfPersonalinfo> etData = new
javax.xml.ws.Holder<TableOfPersonalinfo>(etDataVal);
port.GetPersonalinfo(etData);

I changed the line "TableOfPersonalinfo etDataVal = null;"   into  
"TableOfPersonalinfo etDataVal = new TableOfPersonalinfo();"...

Dont know, how I could not see this... For some reason, the client from
wsdl2java dont initialize the etDataVal. I thought, that I could just copy
the code.

Well, now it works even without the Interceptor.

Thank you all.

Matthew



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772943.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by Daniel Kulp <dk...@apache.org>.
You definitely shouldn’t need to do that.   Can you post the code at:

 at com.sun.proxy.$Proxy44.GetPersonalinfo(Unknown Source) 
        at Test.main(Test.java:33) 

Where you are calling the GetPersonalInfo method should likely just need to have the proper object passed in there. (Assuming the WSDL is correct)

Dan


> On Sep 21, 2016, at 10:24 AM, MRneedHelp <ma...@freenet.de> wrote:
> 
> Hi,
> 
> finally cxf is running. :D
> 
> I compared the actions in SOAP UI and CXF request, but they were the same.
> So i tried to modify the cxf request manually and found this post: 
> http://stackoverflow.com/questions/6915428/how-to-modify-the-raw-xml-message-of-an-outbound-cxf-request
> <http://stackoverflow.com/questions/6915428/how-to-modify-the-raw-xml-message-of-an-outbound-cxf-request>  
> 
> I changed the xml request manually to the SOAP UI request above by using a
> Interceptor and it worked.
> 
> Well, i dont know, why the xml request, which cxf create, is false. It seems
> strange to me, to manually modify the xml message. 
> Then I could have just used my XML solution with a HttpURLConnection. But i
> will not complain. I got 2 solutions. Last week I thought, that I would
> never get access to the SAP server. :D
> 
> So thank you all for your help!
> 
> Matthew
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772933.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org <ma...@apache.org> - http://dankulp.com/blog <http://dankulp.com/blog>
Talend Community Coder - http://coders.talend.com <http://coders.talend.com/>

RE: SAP Webservice: None of the policy alternatives can be satisfied

Posted by kupkaj <ju...@gmail.com>.
Just out of curiosity, could you post the exact code which you are using to
invoke cxf client in java? I find that hard to believe that xml is being
generated incorrectly. Most likely there is something missing in your code.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772934.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
Hi,

finally cxf is running. :D

I compared the actions in SOAP UI and CXF request, but they were the same.
So i tried to modify the cxf request manually and found this post: 
http://stackoverflow.com/questions/6915428/how-to-modify-the-raw-xml-message-of-an-outbound-cxf-request
<http://stackoverflow.com/questions/6915428/how-to-modify-the-raw-xml-message-of-an-outbound-cxf-request>  

I changed the xml request manually to the SOAP UI request above by using a
Interceptor and it worked.

Well, i dont know, why the xml request, which cxf create, is false. It seems
strange to me, to manually modify the xml message. 
Then I could have just used my XML solution with a HttpURLConnection. But i
will not complain. I got 2 solutions. Last week I thought, that I would
never get access to the SAP server. :D

So thank you all for your help!

Matthew



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772933.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAP Webservice: None of the policy alternatives can be satisfied

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

As far as I see you specifies empty <EtData> element in SOAP Request, but do not send it with CXF request.
That can be the reason of error on the server side.
Other possible reason can be different SoapAction.

Could you initialize the GetPersonalinfo with EtData and retry? 
If it doesn't help, compare SoapAction in SoapUI and CXF request.

Regards,
Andrei.

> -----Original Message-----
> From: MRneedHelp [mailto:matthias.rudingsdorfer@freenet.de]
> Sent: Mittwoch, 21. September 2016 13:41
> To: users@cxf.apache.org
> Subject: Re: SAP Webservice: None of the policy alternatives can be satisfied
> 
> When I use logging, I get this message:
> 
> INFORMATION: Outbound Message
> ---------------------------
> ID: 1
> Address: wsdl-addres from SOAP UI
> Encoding: UTF-8
> Http-Method: POST
> Content-Type: text/xml
> Headers: {Accept=[*/*],
> SOAPAction=["urn:sap-com:document:sap:soap:functions:mc-
> style:PERSONALINFO:GetPersonalinfoRequest"]}
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:G
> etPersonalinfo
> xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-
> style"/></soap:Body></soap:Envelope>
> --------------------------------------
> Sep 21, 2016 1:26:30 PM
> org.apache.cxf.services.GETPERSONALINFOService.GET_PERSONALINFOPort.GE
> T_PERSONALINFO
> INFORMATION: Inbound Message
> ----------------------------
> ID: 1
> Response-Code: 500
> Encoding: UTF-8
> Content-Type: text/xml; charset=utf-8
> Headers: {Accept=[text/xml], connection=[close], Content-Length=[457],
> content-type=[text/xml; charset=utf-8], sap-
> srt_id=[20160921/132630/v1.00_final_6.40/0050569750C01EE69FFDC7C0F06D
> CB4E],
> set-cookie=[sap-usercontext=sap-client=100; path=/]}
> Payload: <soap-env:Envelope
> xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-
> env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-
> env:Server</faultcode><faultstring
> xml:lang="en">Fehler bei der Web-Service-Verarbeitung; Weitere Details im
> Web-Service-Fehlerprotokoll auf Provider-Seite </faultstring><detail/></soap-
> env:Fault></soap-env:Body></soap-env:Envelope>
> 
> 
> Payload: <soap:Envelope
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:G
> etPersonalinfo
> xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-
> style"/></soap:Body></soap:Envelope>
> If that is the request, which is sent, i know, why it doesnt work. This request
> doesnt even work in SOAP UI. It must look like the request I sent above.
> 
> When I sent this request with SOAP UI, I get exactly the same message as I get
> it here:
> 
> Payload: <soap-env:Envelope
> xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-
> env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-
> env:Server</faultcode><faultstring
> xml:lang="en">Fehler bei der Web-Service-Verarbeitung; Weitere Details im
> Web-Service-Fehlerprotokoll auf Provider-Seite </faultstring><detail/></soap-
> env:Fault></soap-env:Body></soap-env:Envelope>
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAP-
> Webservice-None-of-the-policy-alternatives-can-be-satisfied-
> tp5772704p5772929.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
When I use logging, I get this message:

INFORMATION: Outbound Message
---------------------------
ID: 1
Address: wsdl-addres from SOAP UI
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml
Headers: {Accept=[*/*],
SOAPAction=["urn:sap-com:document:sap:soap:functions:mc-style:PERSONALINFO:GetPersonalinfoRequest"]}
Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:GetPersonalinfo
xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-style"/></soap:Body></soap:Envelope>
--------------------------------------
Sep 21, 2016 1:26:30 PM
org.apache.cxf.services.GETPERSONALINFOService.GET_PERSONALINFOPort.GET_PERSONALINFO
INFORMATION: Inbound Message
----------------------------
ID: 1
Response-Code: 500
Encoding: UTF-8
Content-Type: text/xml; charset=utf-8
Headers: {Accept=[text/xml], connection=[close], Content-Length=[457],
content-type=[text/xml; charset=utf-8],
sap-srt_id=[20160921/132630/v1.00_final_6.40/0050569750C01EE69FFDC7C0F06DCB4E],
set-cookie=[sap-usercontext=sap-client=100; path=/]}
Payload: <soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-env:Server</faultcode><faultstring
xml:lang="en">Fehler bei der Web-Service-Verarbeitung; Weitere Details im
Web-Service-Fehlerprotokoll auf Provider-Seite
</faultstring><detail/></soap-env:Fault></soap-env:Body></soap-env:Envelope>


Payload: <soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:GetPersonalinfo
xmlns:ns2="urn:sap-com:document:sap:soap:functions:mc-style"/></soap:Body></soap:Envelope>
If that is the request, which is sent, i know, why it doesnt work. This
request doesnt even work in SOAP UI. It must look like the request I sent
above.

When I sent this request with SOAP UI, I get exactly the same message as I
get it here:

Payload: <soap-env:Envelope
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-env:Server</faultcode><faultstring
xml:lang="en">Fehler bei der Web-Service-Verarbeitung; Weitere Details im
Web-Service-Fehlerprotokoll auf Provider-Seite
</faultstring><detail/></soap-env:Fault></soap-env:Body></soap-env:Envelope>



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772929.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAP Webservice: None of the policy alternatives can be satisfied

Posted by Andrei Shakirin <as...@talend.com>.
Hi,

> Andrei, I dont exactly know, what you mean with "without using wsdl". I need
> the wsdl to generate the java code from wsdl2java. I tryed to use the
> JaxWSFactoryBean, but , as i said in my post, i get an exception creating the
> service.

Of course, you will still need the WSDL to generate the code, but you can bypass it at the runtime, when you doing the call.
CXF Runtime will send the SOAP on the base of annotations in generated class and ignore the policies.
Of course, it will work only if server side doesn't require the special parts in request added by policies (security headers, etc)

You said that clients like SoapUI works, therefore I recommend you a way bypassing policy stuff at runtime and send "pure" SOAP request to the server.

Regards,
Andrei.

> -----Original Message-----
> From: MRneedHelp [mailto:matthias.rudingsdorfer@freenet.de]
> Sent: Montag, 19. September 2016 14:08
> To: users@cxf.apache.org
> Subject: Re: SAP Webservice: None of the policy alternatives can be satisfied
> 
> Hi,
> 
> thanks for the answers. I think your solution would be the best, mbeards.
> These policies are really upsetiing me...
> 
> I have solved it now with a HttpURLConnection, with which i send the request as
> a xml and get the response as a xml (as it is in SOAP UI). Here the policies are
> no problem... without any work around. I dont know, why they are such a hugh
> problem in cxf :/
> 
> Andrei, I dont exactly know, what you mean with "without using wsdl". I need
> the wsdl to generate the java code from wsdl2java. I tryed to use the
> JaxWSFactoryBean, but , as i said in my post, i get an exception creating the
> service.
> 
> Matthew
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAP-
> Webservice-None-of-the-policy-alternatives-can-be-satisfied-
> tp5772704p5772858.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by MRneedHelp <ma...@freenet.de>.
Hi,

thanks for the answers. I think your solution would be the best, mbeards.
These policies are really upsetiing me... 

I have solved it now with a HttpURLConnection, with which i send the request
as a xml and get the response as a xml (as it is in SOAP UI). Here the
policies are no problem... without any work around. I dont know, why they
are such a hugh problem in cxf :/

Andrei, I dont exactly know, what you mean with "without using wsdl". I need
the wsdl to generate the java code from wsdl2java. I tryed to use the
JaxWSFactoryBean, but , as i said in my post, i get an exception creating
the service.

Matthew



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772858.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAP Webservice: None of the policy alternatives can be satisfied

Posted by mbeards <mb...@soundevelopment.com>.
Hey Matthew,

I recently struggled through getting a CXF client connection working with
SAP's generated WSDL files... In the end I was lucky. I was able to get the
SAP administrator to update the WSDL. There is a configuration screen in the
SAP UI when you export an IDOC interface as a web service where you can
change the defaults and set "Standard" and "No SAP Functionality" for the
WSDL. This will make all of the proprietary SAP WS-Security policies
optional and remove the stuff that breaks CXF.

I can attempt to get a screen shot from our SAP people if you are in a
similar situation and can get your SAP instance changed.

Michael



--
View this message in context: http://cxf.547215.n5.nabble.com/SAP-Webservice-None-of-the-policy-alternatives-can-be-satisfied-tp5772704p5772738.html
Sent from the cxf-user mailing list archive at Nabble.com.