[jpos-users] NACChannel TPD swap not working

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jpos-users] NACChannel TPD swap not working

jayadeep.cse
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/659014e4-abfe-4707-895b-0e613c77f501%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [jpos-users] NACChannel TPD swap not working

chhil


The NACChannel the tpdu to be a header of width 5. It only swaps it then.
What is your header configured as in the channel definition?
Maybe try stepping through the NACChannel code to see why its not swapping?

You can take a look at the the sendMessageHeader of the NACChannel here.

-chhil

On Wed, Dec 21, 2016 at 5:25 PM, jayadeep.cse <[hidden email]> wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/659014e4-abfe-4707-895b-0e613c77f501%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefD0mVg5P8%2Bs2EPitiqnx4pdHsij5%2Bc_F1bf%2BqjQ2dSKwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jpos-users] Re: NACChannel TPD swap not working

jayadeep.cse
In reply to this post by jayadeep.cse
Thanks a lot Chhil. It seems to me, its because of length more than 5 byte TPDU is not getting swapped. I will look into this.

Thanks a ton.

Jayadeep

On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/74f24b61-ddeb-4b42-bfec-183c6e0454e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jpos-users] Re: NACChannel TPD swap not working

jayadeep.cse
In reply to this post by jayadeep.cse
Hi Chill,

Thanks a lot for your help. The length was of 5 bytes always but somehow the sendMessageHeader was not getting invoked causing this issue. 
I instantiated the response message by cloning the request message and it is working now. 

Thanks,
Jayadeep


On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/fc36ccc8-1717-463a-9291-839c5821aef0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [jpos-users] Re: NACChannel TPD swap not working

chhil
Glad to hear its working. I think the sendMessageHeader always gets called from the basechannel, so there is still something wrong, you shouldnt have to do anything by hand.


I have been using this example all morning another thread. 

The client sends a message using NACChannel, and uses tpdu of 0x0 0x1 0x2 0x3 0x4 
The server responds back and you can see the header/tpdu with bits swapped in the server send and visible also in the clients receive.
Nothing additional had to be done.

import java.io.IOException;

import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISORequestListener;
import org.jpos.iso.ISOServer;
import org.jpos.iso.ISOSource;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.channel.NACChannel;
import org.jpos.iso.packager.ISO87APackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
import org.jpos.util.ThreadPool;

public class Test {

    public static void main(String[] args) throws ISOException, IOException {

        Logger l = new Logger();
        l.addListener(new SimpleLogListener());
        NACChannel sc = new NACChannel(new ISO87APackager(), new byte[] { 5, 6, 7, 8, 9 });

        sc.setLogger(l, "serverchannel");
        ISOServer server = new ISOServer(7776, sc, new ThreadPool(10, 100));
        server.setLogger(l, "server");
        server.addISORequestListener(new ISORequestListener() {

            @Override
            public boolean process(ISOSource source, ISOMsg m) {

                System.out.println(ISOUtil.hexdump(m.getHeader()));
                try {
                    m.dump(System.out, ">>");
                    m.setResponseMTI();
                    source.send(m);
                }
                catch (ISOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                return true;
            }
        });
        Thread t = new Thread(server);
        t.start();
        NACChannel cs = new NACChannel("127.0.0.1", 7776, new ISO87APackager(), new byte[] { 0, 1, 2, 3, 4 });
        cs.setLogger(l, "clientchannel");
        ISOMsg m = new ISOMsg();
        m.setMTI("0200");
        m.set(2, "123456789");

        cs.connect();
        cs.send(m);
        cs.receive();
    }
}


output

<log realm="server" at="Thu Dec 22 15:47:53 IST 2016.283" lifespan="57ms">
  <iso-server>
    listening on port 7776
  </iso-server>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.305" lifespan="82ms">
  <connect>
    127.0.0.1:7776
  </connect>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.309" lifespan="3ms">
  <send>
    <isomsg direction="outgoing">
      <!-- org.jpos.iso.packager.ISO87APackager -->
      <field id="0" value="0200"/>
      <field id="bitmap" value="{2}" type="bitmap"/>
      <field id="2" value="123456789"/>
    </isomsg>
  </send>
</log>
<log realm="serverchannel/127.0.0.1:40262" at="Thu Dec 22 15:47:53 IST 2016.314" lifespan="2ms">
  <receive>
    <isomsg direction="incoming">
      <!-- org.jpos.iso.packager.ISO87APackager -->
      <header>0001020304</header>
      <field id="0" value="0200"/>
      <field id="bitmap" value="{2}" type="bitmap"/>
      <field id="2" value="123456789"/>
    </isomsg>
  </receive>
</log>

>><isomsg direction="incoming">
>>  <!-- org.jpos.iso.packager.ISO87APackager -->
>>  <header>0001020304</header>
>>  <field id="0" value="0200"/>
>>  <field id="bitmap" value="{2}" type="bitmap"/>
>>  <field id="2" value="123456789"/>
>></isomsg>
<log realm="serverchannel/127.0.0.1:40262" at="Thu Dec 22 15:47:53 IST 2016.315">
  <send>
    <isomsg direction="outgoing">
      <!-- org.jpos.iso.packager.ISO87APackager -->
      <header>0003040102</header>
      <field id="0" value="0210"/>
      <field id="bitmap" value="{2}" type="bitmap"/>
      <field id="2" value="123456789"/>
    </isomsg>
  </send>
</log>
<log realm="clientchannel/127.0.0.1:7776" at="Thu Dec 22 15:47:53 IST 2016.316" lifespan="6ms">
  <receive>
    <isomsg direction="incoming">
      <!-- org.jpos.iso.packager.ISO87APackager -->
      <header>0003040102</header>
      <field id="0" value="0210"/>
      <field id="bitmap" value="{2}" type="bitmap"/>
      <field id="2" value="123456789"/>
    </isomsg>
  </receive>
</log>



On Thu, Dec 22, 2016 at 3:24 PM, jayadeep.cse <[hidden email]> wrote:
Hi Chill,

Thanks a lot for your help. The length was of 5 bytes always but somehow the sendMessageHeader was not getting invoked causing this issue. 
I instantiated the response message by cloning the request message and it is working now. 

Thanks,
Jayadeep


On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/fc36ccc8-1717-463a-9291-839c5821aef0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAPazefAOWK4-2wCU01Esdkrjp3LAttMF3LEhUoSDLb8%2Bapw27A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jpos-users] Re: NACChannel TPD swap not working

jayadeep.cse
In reply to this post by jayadeep.cse
I see. May be I need to dig out more to find out the root cause that I will.

Thanks,
Jayadeep

On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/63cd81aa-2339-42b8-9b22-c8430f6a133d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [jpos-users] Re: NACChannel TPD swap not working

Andrés Alcarraz

Hi Jayadeep, it would be helpful to see your server simulator setup including your bsh script, maybe you are missing the header when you create the response, how are you building it?

Haw are you sure the sendMessageHeader is not being called at all? It is somehow impossinbe since it is in the path of the send method.

Best regards and happy holidays for all jpos-users group.


Andrés.



El 22/12/16 a las 22:43, jayadeep.cse escribió:
I see. May be I need to dig out more to find out the root cause that I will.

Thanks,
Jayadeep

On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/63cd81aa-2339-42b8-9b22-c8430f6a133d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/9832aa26-67bd-c692-50a5-028d4e09ba79%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[jpos-users] Re: NACChannel TPD swap not working

jayadeep.cse
In reply to this post by jayadeep.cse
Hi Andrés,


Yes the header was missing when I create the response message causing this issue.

Thanks,
Jayadep

On Wednesday, December 21, 2016 at 7:55:51 PM UTC+8, jayadeep.cse wrote:
Hi All,

Below is my 10_server_simulator.xml  chennel specification file -
 
<channel name="MMSChannel" class="org.jpos.iso.channel.NACChannel" logger="Q2" realm="NETSChannel" packager="org.jpos.iso.packager.GenericPackager" header="xxxxxxxxxx">
        <property name="packager-config" value="iso87ascii.xml" />
        <property name="packager-logger" value="Q2"/>
</channel>


I am using QServer and GenericPackager. 
 The problem I am facing is TPDU is not getting swapped for response message. Even I have tried doing it manually. Got the header from request, swapped the bytes and assigned the header to the response. But still it is not getting swapped.

Any inputs on this please.


Thanks,
Jayadeep

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: [hidden email]
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/345e1893-f595-41c1-a5f3-e909fa46f517%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...