Error when use AS4ClientUserMessage to send signed message #126
Replies: 2 comments
-
Dear Philip @phax , have fixed, I add "phase4.wss4j.syncsecurity" with true, and it worked successful. Please ignore it, thanks. /** Best Regards, |
Beta Was this translation helpful? Give feedback.
-
Hi Tomi Lin, Your way of chaning the configuration is very hardcore :) You could also add the line
in your application.properties file :) hth |
Beta Was this translation helpful? Give feedback.
-
Dear Philip @phax ,
I meet a error when I used AS4ClientUserMessage to send a signed message in springboot,the code as follow:
/**
AS4ClientUserMessage as4Client = createMandatoryAttributesSuccessMessage()
as4Client.addAttachment(new File('C:\Users\LINTO3\Downloads\text.edi'), CMimeType.APPLICATION_JSON,null)
as4Client = setKeyStoreSign(as4Client)
as4Client.signingParams().setAlgorithmSign(ECryptoAlgorithmSign.RSA_SHA_256)
.setAlgorithmSignDigest (ECryptoAlgorithmSignDigest.DIGEST_SHA_256);
AS4ClientSentMessage as4ClientSentMessage = as4Client.sendMessageWithRetries('http://127.0.0.1:9090/holodeckb2b/as4',
new BasicHttpClientResponseHandler(),
null,
null,
null)
log.info("Message Id: {}, Response body: {}", as4ClientSentMessage.messageID, as4ClientSentMessage.response)
**/
If I send data without setAlgorithmSignDigest , the result is successful.
But when I send a data with setAlgorithmSignDigest, " No global scope object has been set!" is appeared.
I have config the jaxb and littleproxy in build.gradle.
May you give me some advices?
/**
java.lang.IllegalStateException: No global scope object has been set!
at com.helger.scope.mgr.ScopeManager.getGlobalScope(ScopeManager.java:159) ~[ph-scopes-11.0.4.jar:11.0.4]
at com.helger.scope.singleton.AbstractGlobalSingleton._getStaticScope(AbstractGlobalSingleton.java:48) ~[ph-scopes-11.0.4.jar:11.0.4]
at com.helger.scope.singleton.AbstractGlobalSingleton.getGlobalSingleton(AbstractGlobalSingleton.java:65) ~[ph-scopes-11.0.4.jar:11.0.4]
at com.helger.phase4.wss.WSSConfigManager.getInstance(WSSConfigManager.java:49) ~[phase4-lib-2.1.0.jar:2.1.0]
at com.helger.phase4.messaging.crypto.AS4Signer.createSignedMessage(AS4Signer.java:186) ~[phase4-lib-2.1.0.jar:2.1.0]
at com.helger.phase4.client.AS4ClientUserMessage.buildMessage(AS4ClientUserMessage.java:668) ~[phase4-lib-2.1.0.jar:2.1.0]
at com.helger.phase4.client.AbstractAS4Client.sendMessageWithRetries(AbstractAS4Client.java:457) ~[phase4-lib-2.1.0.jar:2.1.0]
at com.helger.phase4.client.AbstractAS4Client$sendMessageWithRetries$3.call(Unknown Source) ~[na:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-3.0.9.jar:3.0.9]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[groovy-3.0.9.jar:3.0.9]
at com.cargosmart.phase4as4.service.As4Service.sendFile(As4Service.groovy:29) ~[classes/:na]
at com.cargosmart.phase4as4.service.As4Service$sendFile.call(Unknown Source) ~[na:na]
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47) ~[groovy-3.0.9.jar:3.0.9]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[groovy-3.0.9.jar:3.0.9]
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130) ~[groovy-3.0.9.jar:3.0.9]
at com.cargosmart.phase4as4.controller.AS4Controller.updateCustomerSignCer(AS4Controller.groovy:24) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
**/
Best Regards,
Tomi Lin
Beta Was this translation helpful? Give feedback.
All reactions