Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

[BUG] Authentication problem with SoapConnection ? #113

Open
1 of 4 tasks
apocheau opened this issue Dec 13, 2019 · 2 comments
Open
1 of 4 tasks

[BUG] Authentication problem with SoapConnection ? #113

apocheau opened this issue Dec 13, 2019 · 2 comments
Labels

Comments

@apocheau
Copy link

apocheau commented Dec 13, 2019

Describe the bug

EDIT 2019/12/16
See my second comment, my endpoint was not good.
The problem is "ErrorCode 2" with every request send with SoapConnection.

Hello, I am trying to create a SendClassification for sending an email to a DataExtension. I am using FuelSDK-Java 1.5.0 and I am able to work with DataExtensions and the REST API for ContentBuilder. I now want to send mailings.
As i have to use SOAP API to work with this objet, i try to use ETSoapConnection to send CreateRequest for object creations. But when i execute the request, i get an HTTPException '405 not allowed'.

Do you think it is a bug, should i use the SDK another way ?
Any input would be appreciated !

Thanks !

Here is the exception:

2019-12-13 15:21:26 WARN  PhaseInterceptorChain:449 - Interceptor for {http://exacttarget.com/wsdl/partnerAPI}PartnerAPI#{http://exacttarget.com/wsdl/partnerAPI}Create has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
	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.$Proxy118.create(Unknown Source)
	at io.xxx.connector.marketingcloud.service.SendService.send(SendService.java:73)
	at io.xxx.connector.marketingcloud.controller.v1.MarketingCloudController.send(MarketingCloudController.java:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.apache.cxf.transport.http.HTTPException: HTTP response '405: Method Not Allowed' when communicating with https://mcgdn-XXX.soap.marketingcloudapis.com/
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1577)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1532)
	at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330)
	at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:215)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
	at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 60 more

To Reproduce
Use code below.

Expected behavior
I expect the request to be accepted by MarketingCloud.

Code snippet
ETSoapConnection soapConnection = null;
try {
soapConnection = new ETSoapConnection(etClient, "https://mcgdn-XXX.soap.marketingcloudapis.com/", etClient.getAccessToken());
} catch (ETSdkException e) {
log.error("Error creating SOAP connection");
}

SendClassification sendClassification = new SendClassification();
sendClassification.setObjectID("CUSTOMER_KEY");
sendClassification.setCustomerKey("CUSTOMER_KEY");
sendClassification.setName("CUSTOMER_KEY");
CreateRequest createRequest = new CreateRequest();
createRequest.getObjects().add(sendClassification);
CreateResponse createResponse = soapConnection.getSoap().create(createRequest);

Environment

  • SDK Version: 1.5.0
  • Java/ JDK version: 11

The bug has the severity

  • Critical: The defect affects critical functionality or critical data. It does not have a workaround.
  • Major: The defect affects major functionality or major data. It has a workaround but is not obvious and is difficult.
  • Minor: The defect affects minor functionality or non-critical data. It has an easy workaround.
  • Trivial: The defect does not affect functionality or data. It does not even need a workaround. It does not impact productivity or efficiency. It is merely an inconvenience.
@apocheau apocheau added the bug label Dec 13, 2019
@apocheau
Copy link
Author

Here are additionnal logs at application startup:

2019-12-13 15:20:53 DEBUG HTTPConduit:922 - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been (re)configured for plain http. 2019-12-13 15:20:53 DEBUG HTTPConduit:394 - No Trust Decider configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' 2019-12-13 15:20:53 DEBUG HTTPConduit:407 - No Auth Supplier configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' 2019-12-13 15:20:53 DEBUG HTTPConduit:426 - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been configured for plain http. 2019-12-13 15:20:53 DEBUG HTTPConduit:49 - registering incoming observer: org.apache.cxf.transport.TransportURIResolver$1@796fe2b5 2019-12-13 15:20:53 DEBUG HttpsURLConnectionFactory:449 - The location of the key store has not been set via a system parameter or through configuration so the default value of /home/apocheau/.keystore will be used. 2019-12-13 15:20:53 DEBUG HttpsURLConnectionFactory:449 - The key store password has not been set via a system property or through configuration, reading data from the keystore will fail. 2019-12-13 15:20:53 DEBUG HttpsURLConnectionFactory:449 - The key password has not been set via a system property or through configuration, reading data from the keystore will fail. 2019-12-13 15:20:53 TRACE HttpsURLConnectionFactory:179 - No default keystore /home/apocheau/.keystore 2019-12-13 15:20:53 DEBUG HttpsURLConnectionFactory:449 - The cipher suites have been set to [Ljava.lang.String;@79424f25. 2019-12-13 15:20:53 DEBUG Headers:283 - Accept: */* 2019-12-13 15:20:53 DEBUG HTTPConduit:1764 - No Trust Decider for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit'. An afirmative Trust Decision is assumed. 2019-12-13 15:20:54 DEBUG ServiceImpl:430 - creating port for portName 2019-12-13 15:20:54 DEBUG ServiceImpl:431 - endpoint reference: 2019-12-13 15:20:54 DEBUG ServiceImpl:432 - endpoint interface: 2019-12-13 15:20:54 INFO ReflectionServiceFactoryBean:388 - Creating Service {http://exacttarget.com/wsdl/partnerAPI}PartnerAPI from WSDL: jar:file:/home/apocheau/.m2/repository/com/github/salesforce-marketingcloud/fuelsdk/1.5.0/fuelsdk-1.5.0.jar!/etframework.wsdl 2019-12-13 15:20:54 DEBUG HTTPConduit:922 - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been (re)configured for plain http. 2019-12-13 15:20:54 DEBUG HTTPConduit:394 - No Trust Decider configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' 2019-12-13 15:20:54 DEBUG HTTPConduit:407 - No Auth Supplier configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' 2019-12-13 15:20:54 DEBUG HTTPConduit:426 - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been configured for plain http. 2019-12-13 15:20:54 DEBUG HTTPConduit:49 - registering incoming observer: org.apache.cxf.transport.TransportURIResolver$1@6d4d0a14 2019-12-13 15:20:54 DEBUG HttpsURLConnectionFactory:449 - The cipher suites have been set to [Ljava.lang.String;@1cca3e8c. 2019-12-13 15:20:54 DEBUG Headers:283 - Accept: */* 2019-12-13 15:20:54 DEBUG HTTPConduit:1764 - No Trust Decider for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit'. An afirmative Trust Decision is assumed. 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Create cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Retrieve cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Update cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Delete cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Query cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Describe cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Execute cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Perform cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Configure cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Schedule cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}VersionInfo cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}Extract cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:54 DEBUG WSDLServiceBuilder:696 - Operation {http://exacttarget.com/wsdl/partnerAPI}GetSystemStatus cannot be unwrapped, input message must reference global element declaration with same localname as operation 2019-12-13 15:20:55 DEBUG JAXBDataBinding:333 - Created JAXBContext "jar:file:/home/apocheau/.m2/repository/com/sun/xml/bind/jaxb-impl/2.2.11/jaxb-impl-2.2.11.jar!/com/sun/xml/bind/v2/runtime/JAXBContextImpl.class Build-Id: 2.2.11

@apocheau
Copy link
Author

Changing the soap endpoint:
from: https://mcgdn-xxx.soap.marketingcloudapis.com/
to: https://mcgdn-xxx.soap.marketingcloudapis.com/Service.asmx

I now get this errorCode 2:

<CreateResponse xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <Results>
        <StatusCode>Error</StatusCode>
        <StatusMessage>Exception occurred during [CreateSendClassification] ErrorID: 1001281912</StatusMessage>
        <OrdinalID>0</OrdinalID>
        <ErrorCode>2</ErrorCode>
        <NewID>0</NewID>
        <Object xsi:type="SendClassification">
          <PartnerKey xsi:nil="true"/>
          <ModifiedDate xsi:nil="true"/>
          <ObjectID>CUSTOMER_KEY</ObjectID>
          <CustomerKey>CUSTOMER_KEY</CustomerKey>
          <Name>CUSTOMER_KEY</Name>
        </Object>
      </Results>
      <RequestID>0387ec3e-bc0a-4853-98f4-9ab74da5c648</RequestID>
      <OverallStatus>Error</OverallStatus>
    </CreateResponse>

From https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/0_99.htm error code 2 means:

2 | System - General Exception | Exception occurred during [{Operation}] ErrorID: {ErrorID} | You may encounter this error code on a SOAP fault during authentication (login has an unexpected exception). Log error information and contact Marketing Cloud support.

Is there something about authentication i should do?

... And about the Marketing Cloud support, they do not answer questions about API.

@apocheau apocheau changed the title [BUG] 405 Method not allowed creating SendClassification/EmailSendDefinition [BUG] Authentication problem with SoapConnection ? Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant